import request from '@/utils/request'

// 查询信息管理列表
export function listArticle(query) {
  return request({
    url: '/information/article/list',
    method: 'get',
    params: query
  })
}

// 查询信息管理列表
export function listByIds(query) {
  return request({
    url: '/information/article/listByIds',
    method: 'get',
    params: query
  })
}
export function removeArticle(data){
  return request({
    url: '/information/article/remove',
    method: 'post',
    data: data
  })
}
// 查询信息管理详细
export function getArticle(id) {
  return request({
    url: '/information/article/' + id,
    method: 'get'
  })
}

// 新增信息管理
export function addArticle(data) {
  return request({
    url: '/information/article',
    method: 'post',
    data: data
  })
}

// 修改信息管理
export function updateArticle(data) {
  return request({
    url: '/information/article',
    method: 'put',
    data: data
  })
}

// 删除信息管理
export function delArticle(id) {
  return request({
    url: '/information/article/' + id,
    method: 'delete'
  })
}

// 导出信息管理
export function exportArticle(ids) {
  return request({
    url: '/information/article/export',
    method: 'post',
    data: ids.join(",")
  })
}

export function exportAllArticle(query){
  return request({
    url: '/information/article/export',
    method: 'get',
    params: query
  })
}

// 导出信息管理
export function exportArticleByCollectionId(collectionId) {
  return request({
    url: '/information/article/exportByCid',
    method: 'post',
    data: {collectionId:collectionId}
  })
}

export function extractAbstract(contents){
  return request({
    url: '/information/article/extractAbstract',
    method: 'post',
    data: {contentsOrg : contents}
  })
}

// 新增信息管理
export function exportWord(data) {
  return request({
    url: '/information/article/exportWord',
    method: 'post',
    data: data
  })
}

export function trans(id){
  return request({
    url: '/information/article/trans',
    method: 'post',
    data: {id : id}
  })
}

// 爬虫获取指定数据源中的指定URL数据
export function callCrawlerByUrl(id) {
  return request({
    url: '/common/callArticleCrawler',
    method: 'post',
    data: {id : id}
  })
}

